/* 重置默认样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    background-color: #f4f4f4;
    color: #333;
    padding: 0;
    margin: 0;
}

/* 头部样式 */
header {
    background-color: #4CAF50;
    color: white;
    text-align: center;
    padding: 2rem 1rem;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

header p {
    font-size: 1.2rem;
}

/* 主内容区域样式 */
main {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

/* 任务输入区域样式 */
.task-input {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.task-input h2 {
    margin-bottom: 1rem;
    color: #4CAF50;
}

#taskForm {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

#taskForm input, #taskForm textarea {
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

#taskForm textarea {
    resize: vertical;
    min-height: 100px;
}

#taskForm button {
    padding: 0.8rem;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s;
}

#taskForm button:hover {
    background-color: #45a049;
}

/* 任务列表区域样式 */
.task-list {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.task-list h2 {
    margin-bottom: 1rem;
    color: #4CAF50;
}

#tasks {
    list-style-type: none;
}

.task-item {
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 1rem;
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.task-item.completed {
    text-decoration: line-through;
    opacity: 0.7;
}

.task-item .task-content {
    flex-grow: 1;
}

.task-item .task-title {
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.task-item .task-description {
    color: #666;
}

.task-item .task-actions {
    display: flex;
    gap: 0.5rem;
}

.task-item button {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
}

.task-item .complete-btn {
    background-color: #4CAF50;
    color: white;
}

.task-item .complete-btn:hover {
    background-color: #45a049;
}

.task-item .delete-btn {
    background-color: #f44336;
    color: white;
}

.task-item .delete-btn:hover {
    background-color: #d32f2f;
}

/* 页脚样式 */
footer {
    background-color: #333;
    color: white;
    text-align: center;
    padding: 1rem;
    margin-top: 2rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    main {
        padding: 1rem;
    }
    
    .task-input, .task-list {
        padding: 1.5rem;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    header p {
        font-size: 1rem;
    }
    
    .task-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .task-item .task-actions {
        margin-top: 1rem;
        align-self: flex-end;
    }
}